#include "utils_string.h"
#include <stdio.h>

int utils_printU8BytesToHexString(char *buffer,
									uint8_t *dat,
									uint8_t len,
									uint8_t caseSen,
									uint8_t endian){

	if(len <= 0 || NULL == buffer || NULL == dat){
		return NULL;
	}

	char *ptrBuf = buffer;

	for(int i = 0; i < len; i ++){
		ptrBuf += sprintf(ptrBuf, caseSen?"%02X":"%02x", endian?dat[len-1-i]:dat[i]);
	}
	ptrBuf[0] = '\0';

	return 0;
}
